package office.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;


public class FileUtil {
	/**
	 * 把文件复制到另外一个地方
	 * @param file
	 * @param path
	 * @throws Exception
	 */
	public static void copyFileToPath(File file,String path) throws Exception
	{
		    FileInputStream  fis = new FileInputStream(file);
	        FileOutputStream fos = new FileOutputStream(path);
	        byte[] buffer = new byte[1024];
	        int len;
	        while((len=fis.read(buffer))>0)
	        {
	        	fos.write(buffer, 0, len);
	        }
	        fos.flush();
	        fis.close();
	        fos.close();
	}
}
